package br.unb.mestrado.simulator.model.context;

import java.util.Date;

import br.unb.mestrado.simulator.model.qos.QoSParameter;

public class ContextInfo implements ContextInfoInterface{

	private Date date;
	private Integer category;
	private Integer identifier;
	private QoSParameter[] qosParameters;
	
	public ContextInfo(Date date, Integer category, Integer identifier) {
		super();
		this.date = date;
		this.category = category;
		this.identifier = identifier;
	}
	
	public ContextInfo(Integer category, Integer identifier) {
		super();
		this.category = category;
		this.identifier = identifier;
	}

	public final Date getDate() {
		return date;
	}
	public final void setDate(Date date) {
		this.date = date;
	}
	public final Integer getCategory() {
		return category;
	}
	public final void setCategory(Integer category) {
		this.category = category;
	}
	public final Integer getIdentifier() {
		return identifier;
	}
	public final void setIdentifier(Integer identifier) {
		this.identifier = identifier;
	}
	
	public QoSParameter[] getQosParameters() {
		return qosParameters;
	}
	
	

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((category == null) ? 0 : category.hashCode());
		result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContextInfo other = (ContextInfo) obj;
		if (category == null) {
			if (other.category != null)
				return false;
		} else if (!category.equals(other.category))
			return false;
		if (identifier == null) {
			if (other.identifier != null)
				return false;
		} else if (!identifier.equals(other.identifier))
			return false;
		return true;
	}
}


